package com.czkevin.biliwsclient;

import com.czkevin.biliwsclient.gift.GiftInfo;
import com.czkevin.biliwsclient.gift.GuardInfo;

import java.util.HashMap;
import java.util.Map;

public class GiftConfig {

    private final Map<Integer, GiftInfo> gifts;
    private final Map<Integer, GuardInfo> guards;

    public GiftConfig() {
        gifts = new HashMap<>();
        guards = new HashMap<>();
    }

    public GiftConfig(Map<Integer, GiftInfo> gifts, Map<Integer, GuardInfo> guards) {
        this.gifts = gifts;
        this.guards = guards;
    }

    public GiftInfo getGift(int giftId) {
        return gifts.get(giftId);
    }

    public GuardInfo getGuard(int level) {
        return guards.get(level);
    }

    public int countGifts() {
        return gifts.size();
    }

    public int countGuards() {
        return guards.size();
    }

    public void merge(GiftConfig another) {
        if (another == null) throw new IllegalArgumentException("null! ");
        gifts.putAll(another.gifts);
        guards.putAll(another.guards);
    }

}
